<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kết quả tìm kiếm</title>
<style type="text/css">
<!--
.style1 {
	font-size: 24px;
	font-weight: bold;
}
.style3 {font-size: 18px}
.style4 {font-weight: bold}
-->
</style>
</head>

<body bgcolor="#330000">
<?php  
	include_once($_SERVER['DOCUMENT_ROOT']."/ketnoiCSDL.php"); 
	session_start();	
	?>
	
<?php
	
	
	$sql="select * from may_bien_ap a,loai_dien_ap b,nha_sx c
	where a.MA_DIEN_AP=b.MA_DIEN_AP and a.MA_NSX=c.MA_NSX and a.SO_N0='";
	$sql.=$_SESSION["N0"]."'";
	$result=mysql_query($sql,$link);
?>
	
     <p align="center" class="style1"><font color="red">THÔNG TIN CƠ BẢN</font>
  <table width="1038" height="188" border="1">
  <tr>
    <td width="27" height="66"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Số N0</strong></div></td>
    <td width="48"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Loại điện áp (U)</strong></div></td>
    <td width="54"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Công suất (S)</strong></div></td>
    <td width="56"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Chiều dài<br />
    (cm)</strong></div></td>
    <td width="56"><span class="style4 style3"><font color="#FFFFFF"><strong>Chiều rộng<br />
(cm)</strong></span></td>
    <td width="58"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Chiều cao(cm) </strong></div></td>
    <td width="41"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Dầu máy<br />
    (kg)</strong></div></td>
    <td width="48"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Ruột máy<br />
    (kg)</strong></div></td>
    <td width="45"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Tổng<br />
    (kg)</strong></div></td>
    <td width="53"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Hãng <br />
    sản xuất</strong></div></td>
    <td width="57"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Nước <br />
    sản xuất</strong></div></td>
    <td width="66" height="66"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Loại dầu </strong></div></td>
    <td width="74" height="66"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Thông số đo </strong></div></td>
    <td width="83" height="66"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Thông tin liên hệ nhà sản xuất </strong></div></td>
    <td width="88" height="66"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Nhận xét </strong></div></td>
    <td width="84"><div align="center" class="style4 style3"><font color="#FFFFFF"><strong>Ghi chú</strong></div></td>
    </tr>
  
    <?php	
  		if(mysql_num_rows($result)!=0)
  			{
  			while($row=mysql_fetch_array($result))
			{
				$c1=$row["SO_N0"];
				$c2=$row["CAP_DIEN_AP"];
				$c3=$row["CONG_SUAT"];
				$c4=$row["CHIEU_DAI"];
				$c5=$row["CHIEU_RONG"];
				$c6=$row["CHIEU_CAO"];
				$c7=$row["DAU_MAY"];
				$c8=$row["RUOT_MAY"];
				$c9=$row["TONG"];
				$c10=$row["TEN_NSX"];
				$c11=$row["TEN_NUOC"];
			
				$c13=$row["THONG_SO_DO"];
				$c14=$row["DIA_CHI_NSX"];
				$c15=$row["NHAN_XET"];
				$c16=$row["GHI_CHU"];
			
				
				echo "<tr style='background-color:#FFFFFF'><td style='background-color:#330000'><font color='#FFFFFF'><b>$c1</b></td>";
				echo "<td>$c2</td>";
				echo "<td>$c3</td>";
				echo "<td>$c4</td>";
				echo "<td>$c5</td>";
				echo "<td>$c6</td>";
				echo "<td>$c7</td>";
				echo "<td>$c8</td>";
				echo "<td>$c9</td>";
				echo "<td>$c10</td>";
				echo "<td>$c11</td>";
				echo "<td>  </td>";
				echo "<td>$c13</td>";
				echo "<td>$c14</td>";
				echo "<td>$c15</td>";
				echo "<td>$c16</td>";
				
			}
		}
      
  ?>
 
</table>
<p>
  
</p>
  
    </p>
  <p align="center" class="style1"><font clor="red"><font color="red">LỊCH SỬ MBA</font> </p>

<?php
	$sql="select * from may_bien_ap a
	where  a.SO_N0='";
	$sql.=$_SESSION["N0"]."'";
	$result=mysql_query($sql,$link);
?>
<p align="left"><strong><font color="#FFFFFF">N&#259;m s&#7843;n xu&#7845;t:
    <label></label>
</strong>&nbsp;&nbsp;
     <?php
  		if(mysql_num_rows($result)!=0)
  			{
			while($row=mysql_fetch_array($result))
			{
				$c1=$row["NAM_SX"];
				echo "<tr><td><b><font color='#FFFFFF'>$c1</b></td>";
				
			}
		}
      
  ?>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;&nbsp;&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p align="left">&nbsp;</p>
<table width="1004" border="0">
  <tr>
    <td width="526"><strong><font color="#FFFFFF">T&igrave;nh tr&#7841;ng : </strong></td>
    <td width="468"><strong><font color="#FFFFFF">Lịch sử vận hành:</strong></td>
  </tr>
  <tr>
    <td><table width="522" border="1">
      <tr>
        <td width="76"><font color="#FFFFFF">Ngày</td>
        <td width="89"><font color="#FFFFFF">Tình trạng </td>
        <td width="335"><font color="#FFFFFF">Diễn giải </td>
      </tr>
      <?php
  	$sql="select * from tinh_trang_may 
	where SO_N0='";
	$sql.=$_SESSION["N0"]."'";
	$result=mysql_query($sql,$link);
  			while($row=mysql_fetch_array($result))
			{
				$c17=$row["NGAY_CO_TINH_TRANG"];
				$c18=$row["TEN_TINH_TRANG_MAY"];
				$c19=$row["DG_TINH_TRANG"];
				
				echo "<tr><td><b>$c17</b></td>";
				echo "<td><b>$c18</b></td>";
				echo "<td><b>$c19</td></b></tr>";
			}
		
      ?>
    </table></td>
    <td><table width="407" border="1">
      <tr>
        <td width="136"><font color="#FFFFFF">Ngày vận hành </td>
        <td width="255"><font color="#FFFFFF">Trạm</td>
        <?php
			$sql="select * from mba_tram a, tram b
		where a.MA_TRAM=b.MA_TRAM and SO_N0='";
		$sql.=$_SESSION["N0"]."'";
		$result=mysql_query($sql,$link);
  		if(mysql_num_rows($result)!=0)
  			{
  			while($row=mysql_fetch_array($result))
			{
				$c1=$row["NGAY_VAN_HANH"];
				$c2=$row["TEN_TRAM"];			
				
				echo "<tr><td><b>$c1</b></td>";				
				echo "<td>$c2</td></tr>";
			}
		}
      ?>
      </tr>
    </table></td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="1007" border="0">
  <tr>
    <td width="530"><strong><font color="#FFFFFF"><font color="#FFFFFF">Lịch sử ngừng vận hành: </strong></td>
    <td width="467"><strong><font color="#FFFFFF"><font color="#FFFFFF">Lịch sử đại tu </strong></td>
  </tr>
  <tr>
    <td><table width="186" border="1">
      <tr>
        <td width="78"><font color="#FFFFFF">Ngày</td>
        <td width="92"><font color="#FFFFFF">Chi tiết ngừng vận hành </td>
        <?php
	$sql="select * from chi_tiet_ngung_van_hanh
	where SO_N0='";
	$sql.=$_SESSION["N0"]."'";
	$result=mysql_query($sql,$link);
  		if(mysql_num_rows($result)!=0)
  			{
  			while($row=mysql_fetch_array($result))
			{
				$c1=$row["NGAY_NGUNG_VH"];
				$c2=$row["DG_NGUNG_VH"];			
				
				echo "<tr><td>$c1</td>";				
				echo "<td>$c2</td></tr>";
			}
		}
      ?>
      </tr>
    </table></td>
    <td><table width="75" border="1">
      <tr>
        <td width="65"><font color="#FFFFFF">Ng&agrave;y</td>
        <?php
  		
  				$sql="select * from chi_tiet_dai_tu
		where SO_N0='";
		$sql.=$_SESSION["N0"]."'";
		$result=mysql_query($sql,$link);
  			while($row=mysql_fetch_array($result))
			{
				$c1=$row["NGAY_DAI_TU"];							
				
				echo "<tr><td>$c1</td></tr>";				
	
			}
		
      ?>
      </tr>
    </table></td>
  </tr>
</table>
<p><strong><font color="#FFFFFF"><font color="#FFFFFF">Chi tiết sở hữu </strong></p>
<table width="401" border="1">
  <tr>
    <td width="150"><font color="#FFFFFF"><font color="#FFFFFF">Ngày</td>
    <td width="235"><font color="#FFFFFF"><font color="#FFFFFF">Đơn vị </td>
	</tr>
	<?php
		$sql="select * from chi_tiet_so_huu a, don_vi b where a.MA_DON_VI=b.MA_DON_VI and SO_N0='".$_SESSION["N0"]."'";
		$result=mysql_query($sql,$link);
		while($row=mysql_fetch_array($result))
		{
			$c1=$row["NGAY_CHUYEN_DEN"];
			$c2=$row["TEN_DON_VI"];
			echo "<tr><td>$c1</td>";
			echo "<td>$c2</td></tr>";
		}
	?>
</table>
<p>&nbsp;</p>
<p align="center">

   <input name="Back" type="submit" onclick="window.close();"  value="Đóng" />

</body>
</html>
